Themes with specified gap images but no actual file crash.
authorJehan <jehan@girinstud.io>
Sun, 17 Nov 2013 11:56:44 +0000 (00:56 +1300)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 23 Nov 2013 03:17:07 +0000 (22:17 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=712536

modules/engines/pixbuf/pixbuf-rc-style.c

index db1830fd610ef0132ae43344ca18e59698f44d6a..1d7972ac5e546887b3cd10636d0d13786ec8fcd2 100644 (file)
@@ -769,6 +769,27 @@ theme_parse_image(GtkSettings  *settings,
       data->overlay = NULL;
     }
 
+  if (data->gap && !data->gap->filename)
+    {
+      g_scanner_warn (scanner, "Gap image options specified without filename");
+      theme_pixbuf_destroy (data->gap);
+      data->gap = NULL;
+    }
+
+  if (data->gap_start && !data->gap_start->filename)
+    {
+      g_scanner_warn (scanner, "Gap start image options specified without filename");
+      theme_pixbuf_destroy (data->gap_start);
+      data->gap_start = NULL;
+    }
+
+  if (data->gap_end && !data->gap_end->filename)
+    {
+      g_scanner_warn (scanner, "Gap end image options specified without filename");
+      theme_pixbuf_destroy (data->gap_end);
+      data->gap_end = NULL;
+    }
+
   if (token != G_TOKEN_RIGHT_CURLY)
     {
       /* error - cleanup for exit */